Skip to content

refactor: commandline#46

Merged
d1rshan merged 4 commits into
mainfrom
refactor/cmdline
Jun 5, 2026
Merged

refactor: commandline#46
d1rshan merged 4 commits into
mainfrom
refactor/cmdline

Conversation

@d1rshan
Copy link
Copy Markdown
Owner

@d1rshan d1rshan commented Jun 2, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 2, 2026

Greptile Summary

This PR refactors the commandline feature by extracting a createCommandlineController hook, inlining CommandlineInput, and switching to a named export — improving separation of concerns. However, the refactor introduces several behavioural regressions that leave the palette in broken states.

  • toggle() only flips isOpen without calling resetSearch() or setScope(\"root\"), so Ctrl+K-to-close leaves a dirty query and scope that re-appear on the next open.
  • The global keydown handler is now always active (not guarded by isOpen), causing Escape and Backspace to have unintended side-effects when the palette is closed.
  • The CommandlineInput is missing bg-transparent and text-(--text), which can produce a white input background that clashes with the dark panel on some browsers.

Confidence Score: 2/5

The commandline palette has multiple regressions — stale state on keyboard close, always-on key listeners with unintended effects, missing theme reset on backdrop close, and lost input styling — that together make the feature unreliable.

The core close path via toggle() (Ctrl+K) leaves query and scope dirty, causing the palette to reopen in a wrong state. Combined with the always-active Escape listener and the theme-reset gap noted in earlier threads, the refactored controller introduces more breakage than the original on the main interaction paths.

apps/frontend/src/features/commandline/components/commandline.tsx needs careful attention — both the toggle() close path and the global keydown handler logic.

Important Files Changed

Filename Overview
apps/frontend/src/features/commandline/components/commandline.tsx Major refactor extracting a createCommandlineController hook; introduces several behavioural regressions including stale query/scope on Ctrl+K close, always-active key listener side effects, and missing input styling
apps/frontend/src/features/commandline/components/commandline-input.tsx File deleted — its contents were inlined into commandline.tsx; no independent logic changes
apps/frontend/src/app/layout.tsx Import updated from default to named export to match the refactored commandline component; straightforward change

Reviews (3): Last reviewed commit: "revert keybind" | Re-trigger Greptile

Comment thread apps/frontend/src/features/commandline/components/commandline.tsx
Comment thread apps/frontend/src/features/commandline/components/commandline.tsx
Comment thread apps/frontend/src/features/commandline/components/commandline.tsx
Comment thread apps/frontend/src/features/commandline/components/commandline.tsx
Comment thread apps/frontend/src/features/commandline/components/commandline.tsx
Comment thread apps/frontend/src/features/commandline/components/commandline.tsx
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 5, 2026

Want your agent to iterate on Greptile's feedback? Try greploops.

@d1rshan d1rshan merged commit 561a291 into main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant